package tedu.week04.day02_thread.lesson4;

/**
 * <pre>
 *      生产者与消费者--生产者.
 *
 * </pre>
 *
 * @author : resty
 * @date : 2019年07月09日    14时
 **/
public class Producer implements Runnable {
    private Info info;

    public Producer(Info info) {
        this.info = info;
    }

    @Override
    public void run() {
        boolean boo = true;
        for (int j = 0; j < 30; j++) {
            if(boo){
                this.info.set("娱乐新闻","这是第"+(j+1)+"天的娱乐新闻");
                boo=false;
            }else{
                this.info.set("体育======新闻","这是第"+(j+1)+"天的=========体育新闻");
                boo=true;
            }
        }
    }
}
